<div id="side_nav">
    <div class="sideNavCategories">
        <h1>MY ACCOUNT</h1>
        <ul class="category departments" id="sidekategori_produk">
			<li id="myproduct_link" style="cursor:pointer;">
				<a>My Product</a>
			</li>
			<li id="topupdeposit_link" style="cursor:pointer;">
				<a>Deposit Ticket</a>
			</li>
			<li id="depositconfirmation_link" style="cursor:pointer;">
				<a>Deposit Confirm</a>
			</li>
			<li id="logout_link" style="cursor:pointer;">
				<a href="<?php echo base_url(); ?>index.php/auth/logout">Logout</a>
			</li>
        </ul>
    </div>
</div>
<div id="main_content">
    
</div>
<script language="javascript">
	var viewdownload = null;
	var show_productbypage = null;
</script>
<script type="text/javascript">
$(document).ready(function(){
	/* VARIABLE STARTS */
	my_config['main_content'] = $("#main_content");
	my_config['catsweatersid'] = $("#catsweatersid");
	/* VARIABLE ENDS */
	
	/* ACTION HANDLER STARTS */
	my_config.catsweatersid.click(function(){
		my_config.main_content.load('index.php/c_cataccount');
	});
	function viewordownload(pid){
		$.ajax({
			url : 'index.php/c_account/download',
			type : 'POST',
			data : {
				pid : pid
			},success : function(msg){
				if(msg !== 0){
					window.open('<?php echo base_url() . 'uploads/files/'; ?>' + msg);
				}
			}
		});
	}
	viewdownload = viewordownload;
	function show_accountbyfiltertopjq(){
		var sortby = $("#account_topsortby").val();
		var show_number = $("#account_topshownumber").val();
		$(".must_empty").empty();
		$("#main_content").empty();
		$("#main_content").load("c_account/v_userproduct?sort=" + sortby + "&shownumber=" + show_number, function(){
			$("#account_topsortby").val(sortby);
			$("#account_topshownumber").val(show_number);
			$("#account_bottomsortby").val(sortby);
			$("#account_bottomshownumber").val(show_number);
		});
	};
	show_accountbyfiltertop = show_accountbyfiltertopjq;
	function show_accountbyfilterbottomjq(){
		var sortby = $("#account_bottomsortby").val();
		var show_number = $("#account_bottomshownumber").val();
		$(".must_empty").empty();
		$("#main_content").empty();
		$("#main_content").load("c_account/v_userproduct?sort=" + sortby + "&shownumber=" + show_number, function(){
			$("#account_topsortby").val(sortby);
			$("#account_topshownumber").val(show_number);
			$("#account_bottomsortby").val(sortby);
			$("#account_bottomshownumber").val(show_number);
		});
	};
	show_accountbyfilterbottom = show_accountbyfilterbottomjq;
	function show_productbypagejq(page){
		var sortby = $("#account_bottomsortby").val();
		var show_number = $("#account_bottomshownumber").val();
		var start = page * show_number;
		$(".must_empty").empty();
		$("#main_content").empty();
		$("#main_content").load("c_account/v_userproduct?sort=" + sortby + "&shownumber=" + show_number + "&start=" + start, function(){
			$("#account_topsortby").val(sortby);
			$("#account_topshownumber").val(show_number);
			$("#account_bottomsortby").val(sortby);
			$("#account_bottomshownumber").val(show_number);
		});
	}
	show_productbypage = show_productbypagejq;
	$("#topupdeposit_link").click(function(){
		$("#main_content").load('index.php/c_topupdeposit');
	});
	$("#depositconfirmation_link").click(function(){
		$("#main_content").load('index.php/c_topupdeposit/index_confirmation');
	});
	$("#button_submitsearch").click(function(){
		var keyword = $(".form-search").find('input').val();
		my_config.main.load('index.php/c_search?key=' + keyword);
	});
	$("#myproduct_link").click(function(){
		$("#main_content").load('index.php/c_account/v_userproduct');
	});
});
</script>